{% extends 'base.html' %}

{% block content %}
<form method="post" style="margin-left: 10px;">
    {% csrf_token %}
    {{ form.as_p }}

    <input type="hidden" name="next" value="/admin/" />

    <div class="form-actions">
        <input type="submit" class="btn btn-primary" style="width:120px;" value="Login" />
    </div>

</form>

<script>
    $('.captcha').click(function () {
        $.getJSON("/captcha/refresh/", function (result) {
            $('.captcha').attr('src', result['image_url']);
            $('#id_captcha_0').val(result['key'])
        });
    });
</script>
{% endblock %}